<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			p {
				width: 50px;
				height: 50px;
				border: 1px solid black;
			}
		</style>
		<script type="text/javascript" src="js/jquery-1.11.1.min.js" ></script>
		<script type="text/javascript">
			$(function(){
				$("input").click(function(){
//					$("p").eq(4).css("background","green");
//					$("#box2 p").eq(2).css("background","green");
					$(".teshu").eq(2).css("background","green");
					//小结：eq()括号中的下标数，与前面的选择器有关
				});
			});
		</script>
	</head>
	<body>
		<input type="button" value="点我" />
		<div id="box1">
			<p></p>
			<p class="teshu"></p>
		</div>
		<div id="box2">
			<p class="teshu"></p>
			<p></p>
			<p class="teshu">请让我变绿</p>
		</div>
	</body>
</html>
